#!/usr/bin/env python

import wx
import sys
import component

class Titles(component.ListCtrl):
    '''Titles class
    
    @author Julot <andy.julot@gmail.com>
    @since Wednesday, January 25, 2012. 06:52 PM'''
    
    def __init__(self, parent):
        style = wx.LC_REPORT | wx.LC_SINGLE_SEL
        component.ListCtrl.__init__(self, parent, style=style)
        self.InsertColumn(1, "Title")
        self.SetColumnWidth(1, wx.LIST_AUTOSIZE)
    
    _values = []
    
    def getValues(self):
        return self._values
    
    def setValues(self, values):
        self._values = values
        self.DeleteAllItems()
        for value in values:
            index = self.InsertStringItem(sys.maxint, label=value.humanValue)
            self.SetItemData(index, value.animeId)
    
    values = property(getValues, setValues)